home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: newshub.ariel.cs.yorku.ca!cs911319
- From: cs911319@ariel.cs.yorku.ca (STEPHEN HOI CHI KONG)
- Subject: Re: SYSTEM CALL RESULT
- X-Nntp-Posting-Host: red
- Message-ID: <DKLvt9.Jz@ariel.cs.yorku.ca>
- Sender: news@ariel.cs.yorku.ca (*)
- Organization: York University, Dept. of Computer Science
- References: <4cbn2i$env@bisance.citi2.fr> <820609309snz@intellic.demon.co.uk>
- Date: Wed, 3 Jan 1996 12:53:33 GMT
-
- In article <820609309snz@intellic.demon.co.uk> truemanc@intellic.demon.co.uk writes:
- >In article <4cbn2i$env@bisance.citi2.fr>
- > labed@math-info.univ-paris5.fr "A.Labed" writes:
- >
- >>
- >>Hi,
- >>
- >>Is there a way to get the result of a
- >>system call within a C program.
- >>example :
- >
- >
- >The exit value of a process is returned by the system call. Therefore
- >if you wrote a small script which computed the line count of the
- >current list of processes and then exited with this value you could
- >pick it up as the return value of the system call.
- >
- >
- >
- > - Chris
- >
- >-============================================================================-
- >IntelliCorp Applications Consultant / E-mail: truemanc@intellic.demon.co.uk
- >LiveModel and PowerModel are part / CServe: 100255,701
- >of IntelliCorp's MODELWORKS / Tel : +44 (0)1344 305305
- >application development suite. / Fax : +44 (0)1344 305100
- >-============================================================================-
-
- I believe you have a more direct approach.
- try
- %man popen
-
- This system call redirect all stdout from external command into
- user buffer (char buf[]). Good Luck.
-
- Zollen
-
-
-
-
-
-
-
-
-
-
-